package com.niit.controller;


import com.niit.pojo.ProductType;
import com.niit.pojo.Supply;
import com.niit.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class TypeController {
    @Autowired
    private TypeService typeService;

    @RequestMapping("/toAddType")
    public String toAddType(){
        return "/addType";
    }

    @RequestMapping("addType")
    public String addType(ProductType productType){
        typeService.addType(productType);
        return "redirect:/toAddProduct";
    }
}
